package com.lkd.service.impl;


import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lkd.entity.VmType;
import com.lkd.mapper.VmTypeMapper;
import com.lkd.service.VmTypeService;
import com.lkd.vo.PageBean;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 售货机类型表 服务实现类
 * </p>
 *
 * @author 聂德祥
 * @since 2024-08-19
 */
@Service
public class VmTypeServiceImpl extends ServiceImpl<VmTypeMapper, VmType> implements VmTypeService {



    @Override
    public PageBean<VmType> search(String name, Integer pageIndex, Integer pageSize) {
        Page<VmType> page = new Page<VmType>(pageIndex, pageSize);
        LambdaQueryWrapper<VmType> like = new LambdaQueryWrapper<VmType>().like(StrUtil.isNotEmpty(name), VmType::getName, name);
        page = getBaseMapper().selectPage(page,like);
        return new PageBean<VmType>(page);
    }
}
